

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>${Inter.printOut('Edit area',session.language)}</title>
    </head>
    <body>
        <div class="undernav">
            <span class="menuButton"><g:link class="list" action="list">${Inter.printOut('Area list',session.language)}</g:link></span>
            <span class="menuButton"><g:link class="create" action="create">${Inter.printOut('New area',session.language)}</g:link></span>
        </div>
        <div class="body">
            <h1>${Inter.printOut('Edit area',session.language)}</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${areaInstance}">
            <div class="errors">
                <g:renderErrors bean="${areaInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <input type="hidden" name="id" value="${areaInstance?.id}" />
                <input type="hidden" name="version" value="${areaInstance?.version}" />
                <input type="hidden" name="container.id" value="${areaInstance?.container?.id}" />
                <div class="dialog">
                    <table>
                        <tbody>  
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="labId">${Inter.printOut('Area id',session.language)}:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:areaInstance,field:'areaId','errors')}">
                                    <input type="text" id="areaId" name="areaId" value="${fieldValue(bean:areaInstance,field:'areaId')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="name">${Inter.printOut('Name',session.language)}:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:areaInstance,field:'name','errors')}">
                                    <input type="text" id="name" name="name" value="${fieldValue(bean:areaInstance,field:'name')}"/>
                                </td>
                            </tr> 
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="type">${Inter.printOut('Type',session.language)}:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:areaInstance,field:'type','errors')}">
                                    <g:select optionKey="id" from="${Type.list()}" name="type.id" value="${areaInstance?.type?.id}" ></g:select>
                                </td>
                            </tr>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="tabs">Tabs:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:areaInstance,field:'tabs','errors')}">
                                  <g:if test="${session.access.hasDevAuth()}">
                                    <g:select name="tabs" from="${Tab.list()}" value="${areaInstance.tabs}" optionKey="id" multiple="multiple" />
                                  </g:if>
                                  <g:else>
                                    <g:select name="tabs" from="${session.access.container.tabs}" value="${areaInstance.tabs}" optionKey="id" multiple="multiple" />
                                  </g:else>
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" value="${Inter.printOut('Update',session.language)}" action="Update"/></span>
                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('${Inter.printOut('Sure',session.language)}');" value="${Inter.printOut('Delete',session.language)}" action="Delete" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
